import type { AppCarousel } from '@/api/modules/data/carousel';
import type { Rule } from 'ant-design-vue/es/form';

const formObj: AppCarousel = {
  id: '',
  picture: '',
  link: '',
  linkTarget: '',
  beginTime: '',
  endTime: null,
  enable: '0',
  sort: 0,
};
export const form = ref({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<keyof AppCarousel, Rule[]> = {
  id: [],
  picture: [],
  link: [],
  linkTarget: [],
  beginTime: [],
  endTime: [],
  enable: [],
  sort: [],
};
